<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<table>
		<tr>
			<td><h2>Report</h2>
			</td>
		</tr>
		<tr>
			<td>
				<table id="rounded-corner" summary="2007 Major IT Companies' Profit">
					<thead>
						<tr>
							<th scope="col" class="rounded-company"><label>No.</label>
							</th>
							<c:forEach var="head" items="${reports}" varStatus="status">
								<th scope="col" class="rounded"><label>${head}</label>
								</th>
							</c:forEach>
							<th scope="col" class="rounded-q4" width="1"></th>
						</tr>
					</thead>
					<tbody>
						<c:forEach var="history" items="${history}" varStatus="status">
							<tr>
								<td>${status.index + pagingInfo.offset + 1}</td>
								<c:forEach var="heade" items="${reports}" varStatus="status">
									<td><c:set var="hist" value="${heade}" /> 
									<c:choose>
										<c:when
											test="${hist == 'code' || hist == 'condition' ||
											hist == 'color' || hist == 'qty' || hist == 'size' || 
											hist == 'description'}">
											${history.item[hist]}
										</c:when>
										<c:when test="${hist == 'name'}">
											${history.user[hist]}
										</c:when>
										<c:when test="${hist == 'position'}">
											${history.location[hist]}
										</c:when>
										<c:when test="${hist == 'floorName'}">
											${history.location.floor[hist]}
										</c:when>
										<c:when test="${hist == 'brandName'}">
											${history.item.brand[hist]}
										</c:when>
										<c:when test="${hist == 'itemType'}">
											${history.item.type[hist]}
										</c:when>
										<c:otherwise>
										</c:otherwise>
									</c:choose></td>
								</c:forEach>
								<td></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>